# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-kwin
pkgver=5.25.11
pkgrel=3
pkgdesc='DDE window manager forked from KWin'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-kwin"
license=('GPL3')
depends=(qt5-declarative qt5-x11extras kconfig5 kconfigwidgets5 kcoreaddons5 kdbusaddons5 kdeclarative5
         kglobalaccel5 ki18n5 kidletime5 knotifications5 kcrash5 kpackage5 plasma-framework5 libepoxy
         kwidgetsaddons5 kwindowsystem5 kcompletion5 kcmutils5 knewstuff5 kservice5 ktextwidgets5 kxmlgui5
         kdecoration kscreenlocker dwayland xcb-util-cursor xorg-xwayland libpipewire
         breeze lcms2 libqaccessibilityclient qt5-quickcontrols python fontconfig freetype2 libcap
         systemd-libs kauth5 bash kactivities5 libxkbcommon libxss libxi libinput xcb-util-wm wayland
         perl libxcb xcb-util-keysyms libx11 libxtst libdrm gcc-libs mesa qt5-base)
makedepends=(extra-cmake-modules kdoctools5 ninja qt5-tools wayland-protocols
             deepin-wayland-protocols)
source=("https://github.com/linuxdeepin/deepin-kwin/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('b2618bae95ae24a7527929a2c8299e6859da3ffe547a1101724bfb2b42ec6a8306ab52fad8fab0581a43cd46f2de81fe3bd56fd6b1d6323a568185eaff504c3f')

prepare() {
  cd deepin-kwin-$pkgver
  sed -i 's|/usr/share/backgrounds/default_background.jpg|/usr/share/backgrounds/deepin/desktop.jpg|' src/effects/multitaskview/multitaskview.cpp
}

build() {
  cd deepin-kwin-$pkgver
  cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBEXECDIR=lib
  ninja
}

package() {
  cd deepin-kwin-$pkgver
  DESTDIR="$pkgdir" ninja install
}
